package WinterVacation.Day11;

public class Num9 {
    public static boolean isPalindrome(int x) {
        if(x < 0){
            return false;
        }
        if(x < 10){
            return true;
        }
        if(x % 10 == 0){
            return false;
        }
        int k = 0;
        int num = x;
        while(x > 0){
            k = x % 10 + k * 10;
            x = x / 10;
        }
        if(k == num){
            return true;
        }else{
            return false;
        }
    }

    public static void main(String[] args) {
        isPalindrome(121);
    }
}
